package net.wsfcp.android.http;


import net.wsfcp.android.BuildConfig;
import net.wsfcp.android.R;
import net.wsfcp.android.base.BaseApplication;

/**
 * Created by Shaoboyang on 2018/12/14.
 * 所有需要的接口地址
 */

public class UrlHelper {
    //设置图片文件服务器根路径
    final public static String SERVICE_IMAGE_BASE_URL = "http://images.yy200.cn";
    //设置音频文件服务器根路径
    final public static String SERVICE_AUDIO_BASE_URL = "http://audios.yy200.cn";
    //设置视频文件服务器根路径
    final public static String SERVICE_VIDEO_BASE_URL = "http://videos.yy200.cn";
    //设置文档文件服务器根路径
    final public static String SERVICE_DOC_BASE_URL = "http://documents.yy200.cn";


    final static boolean IS_TEST = true;


    //    final public static String BASE_URL = "http://ip:port/";
//服务器地址
    final public static String BASE_URL = IS_TEST ? "https://api.wsfcp.com.cn/" : "https://api.wsfcp.cn/";
    final public static String CLIENT_TYPE = "1";//客户端类型 0=PC 1=APP 2=手机 3=小程序
    final public static String PHONE_NUM = "13701766266";//公司电话

    //主页地址拼接
    final public static String HTTP_HEAD = "http://";
    public static String MIDDLE_URL = ".wap.test.wsfcp.com.cn:88";
    final public static String END_URL = "/index_";
    final public static String END_HTML = ".html";

    /*需要动态拼接的地址*/

    //会员登录接口
    public static final String REGISTER = "member/register.uss?user_name=";

    //会员登录接口
    public static final String LOGIN = "member/login.uss?user_name=";

    //会员修改密码接口
    public static final String CHANGE_PASSWORD = "member/update_password.uss?t=";

    //会员获取订单列表接口
    public static final String GET_ORDER_LIST = "member/get_order_list.uss?t=";

    //订单列表数量
    public static final String GET_ORDER_QUANTITY = "member/get_order_quantity.uss?t=";

    //订单详情
    public static final String GET_ORDER_DETAIL = "member/get_order_detail.uss?t=";

    //确认收货
    public static final String CONFIRM_RECEIPT = "member/confirm_receipt.uss?t=";

    //获取所有收货地址
    public static final String GET_RECEIVE_ADDRESS_LIST = "member/get_receive_address_list.uss?t=";

    //保存收货地址
    public static final String SAVE_RECEIVE_ADDRESS = "member/save_receive_address.uss?t=";

    //删除收货地址
    public static final String DELETE_RECEIVE_ADDRESS = "member/delete_receive_address.uss?t=";

    //设置默认收货地址
    public static final String SET_DEFAULT_RECEIVE_ADDRESS = "member/set_default_receive_address.uss?t=";

    //取消订单
    public static final String CANCEL_ORDER = "member/cancel_order.uss?t=";

    //我的账单
    public static final String GET_BILL_LIST = "member/get_bill_list.uss?t=";

    //获取用户总资产
    public static final String GET_TOTAL_ASSETS = "member/get_total_assets.uss?t=";

    //更新用户信息
    public static final String UPDATE_USER = "member/update.uss?t=";


    //app主页网址拼接
    public static String getUserName() {
        return BaseApplication.getContext().getResources().getString(R.string.user_name);
    }

    //app主页网址拼接
    public static String getUserMainUrl() {
        String url = HTTP_HEAD + getUserName() + MIDDLE_URL + END_URL + getUserName() + END_HTML;
        return url;
    }
}
